import {commGet, commPost} from "@utils/service/index.js";

/**
 * 获取sku池列表
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getSkuPool(data) {
    return commGet({
        url: `/ofc/inventory/pool/product/item/page`,
        method: 'get',
        data
    })
}

/**
 * 获取订单详情
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getSkuPoolList(data) {
    return commGet({
        url: `/ofc/inventory/pool/product/item/list/order`,
        method: 'get',
        data
    })
}

/**
 * 获取库存详情
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getInventoryDetail(data) {
    return commGet({
        url: `/ofc/inventory/pool/product/item/list/inventoryDetail`,
        method: 'get',
        data
    })
}

/**
 * 回显调拨数据
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getAllot(data) {
    return commGet({
        url: `/ofc/inventory/pool/product/item/allot/vo`,
        method: 'get',
        data
    })
}

/**
 * 提交调拨
 * @param data
 */
export function submitAllot(data) {
    return commPost({
        url: `/ofc/inventory/pool/product/item/allot/submit`,
        method: 'post',
        data
    })
}

// /**
//  * 批量调拨
//  * @param data
//  */
// export function batchAllot(data) {
//     return commPost({
//         url: `/ofc/inventory/pool/product/item/batchAllot`,
//         method: 'post',
//         data
//     })
// }
